Skip to content

Conversation

@ancheetah
Copy link
Collaborator

@ancheetah ancheetah commented Feb 5, 2026

JIRA Ticket

Description

Updates readmes for most packages except sdk-oidc and journey-client

Summary by CodeRabbit

  • Documentation

    • Updated READMEs across packages with clarified examples, import paths, FIDO browser support note, OIDC/Protect wording, and storage/iframe-manager usage guidance (error-result handling now documented).
  • New Features / API

    • Added optional custom logger support.
    • Introduced createStorage API and updated storage configuration semantics.
    • Device-client docs now show API methods may return an error union.
  • Behavior

    • Iframe manager docs/behavior: error-parameter cases now resolve with parsed params (caller inspects for errors).
  • Tests

    • Re-enabled a previously skipped FIDO end-to-end test.
  • Chores

    • Patch version bumps and README update directives across multiple packages.

@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2026

🦋 Changeset detected

Latest commit: 5a9ea40

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@forgerock/sdk-request-middleware Patch
@forgerock/iframe-manager Patch
@forgerock/storage Patch
@forgerock/sdk-logger Patch
@forgerock/davinci-client Patch
@forgerock/device-client Patch
@forgerock/sdk-utilities Patch
@forgerock/oidc-client Patch
@forgerock/sdk-types Patch
@forgerock/protect Patch
@forgerock/journey-client Patch
@forgerock/sdk-oidc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

Patch-version changeset plus multiple documentation, README/type import cleanups, a storage API docs surface change, an iframe redirect error-handling behavior change (resolve vs reject), and an enabled e2e FIDO test. No runtime API signature changes in source code were introduced.

Changes

Cohort / File(s) Summary
Release Changeset
​.changeset/sour-jobs-count.md
New patch changeset listing patch bumps for multiple @forgerock/* packages and notes to update READMEs/types.
Logger & Protect READMEs
packages/sdk-effects/logger/README.md, packages/protect/README.md
Docs rebrand imports; logger README documents optional custom logger with CustomLogger/LogMessage types; protect README switches examples from @forgerock/javascript-sdk/FRAuth.next to @forgerock/journey-client/journeyClient.next.
Storage docs & test
packages/sdk-effects/storage/README.md, packages/sdk-effects/storage/src/lib/storage.effects.test.ts
Docs replace storage(...) with createStorage(...), add CustomStorageConfig/CustomStorageObject, rename TokenStoreObject → CustomStorageObject, change key semantics to ${prefix}-${name}; test annotation broadened from Omit<StorageConfig,'tokenStore'> to StorageConfig.
Iframe manager: docs & impl
packages/sdk-effects/iframe-manager/README.md, packages/sdk-effects/iframe-manager/src/lib/iframe-manager.effects.ts
Behavioral change: getParamsByRedirect now resolves with all parsed params (including error params) instead of rejecting when error params are present; docs updated to show caller must inspect returned params for error keys.
Request middleware docs/types
packages/sdk-effects/sdk-request-middleware/README.md
Examples updated (endpoint/param renames); README adds actionTypes constant, ActionTypes/EndpointTypes aliases and a more specific RequestMiddleware/QueryReturnValue shape in docs.
Device client README & store cleanup
packages/device-client/README.md, packages/device-client/src/lib/device.store.ts
README updates consolidate imports and change documented API return types to union with { error: unknown }; source file converts several runtime imports to type-only and fixes JSDoc tags.
OIDC & SDK-types docs and small type edits
packages/oidc-client/README.md, packages/sdk-types/README.md, packages/sdk-types/src/lib/authorize.types.ts
OIDC README title/description updated; sdk-types README adds Authorization/Error/Policy subsections and moves build/test commands to nx; minor JSDoc/comment trims in authorize.types.ts.
DaVinci FIDO README & e2e test
packages/davinci-client/src/lib/fido/README.md, e2e/davinci-suites/src/fido.test.ts
FIDO README adds browser support note for navigator.credentials.*; previously skipped e2e FIDO test was enabled.
SDK utilities README
packages/sdk-utilities/README.md
Docs reorganized to add "Error Utilities", example for isGenericError, and switch test/lint commands to nx.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • cerebrl
  • ryanbas21

Poem

🐰 I hopped through changelogs, README trails wide,
nudged docs and types, let an e2e test glide.
I twitched at storage keys and logger delight,
resolved a redirect under softer moonlight,
Hooray — tiny paws left tidy marks inside!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary changes: updating READMEs, fixing types, and updating comments across multiple packages.
Description check ✅ Passed The description provides context about which packages are updated and what changes are made, matching the template structure with JIRA Ticket and Description sections.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch readmes-2.0

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Feb 5, 2026

View your CI Pipeline Execution ↗ for commit 5a9ea40

Command Status Duration Result
nx run-many -t build --no-agents ✅ Succeeded <1s View ↗
nx affected -t build lint test e2e-ci ✅ Succeeded 1m 35s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-11 14:50:59 UTC

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/device-client/src/lib/device.store.ts (2)

339-344: ⚠️ Potential issue | 🟡 Minor

JSDoc description inconsistency: "Get profile devices" should be "Delete profile device".

The @function delete annotation is correct, but the description on line 340 still says "Get profile devices" which doesn't match the delete operation. Similarly, the @param description on line 344 says "used to update a profile device" but should say "used to delete a profile device".

📝 Proposed fix for JSDoc description
       /**
-       * Get profile devices
+       * Delete a profile device
        *
        * `@async`
        * `@function` delete
-       * `@param` {ProfileDevicesQuery} query - The query used to update a profile device
+       * `@param` {ProfileDevicesQuery} query - The query used to delete a profile device
        * `@returns` {Promise<null | { error: unknown }>} - A promise that resolves to null or an error object if the response is not valid.
        */

316-321: ⚠️ Potential issue | 🟡 Minor

JSDoc description inconsistency: "Get profile devices" should describe the update operation.

The description on line 317 says "Get profile devices" but this is the update function. The description should reflect the update operation.

📝 Proposed fix for JSDoc description
       /**
-       * Get profile devices
+       * Update a profile device
        *
        * `@async`
        * `@function` update
        * `@param` {ProfileDevicesQuery} query - The query used to update a profile device
🤖 Fix all issues with AI agents
In `@packages/protect/README.md`:
- Around line 73-77: The README code sample has a typo: the client variable is
spelled "jouneyClient" instead of "journeyClient", which would break copy‑paste;
update the snippet to use the correct symbol "journeyClient.next(step)" so it
matches the rest of the docs and any referenced initialization code.

In `@packages/sdk-effects/iframe-manager/src/lib/iframe-manager.effects.ts`:
- Around line 116-120: Update the JSDoc for the method that uses hasErrorParams
to indicate that when errorParams are present the function now resolves (not
rejects) with parsedParams for context; locate the docstring above the function
containing hasErrorParams/searchParams/errorParams and change wording from
"rejects on error" to something like "resolves with parsed params when
errorParams are present" and mention cleanup() is called before resolve to
preserve expected behavior.

In `@packages/sdk-effects/storage/README.md`:
- Around line 44-54: The README example uses the type GenericError in the
CustomStorageObject method signatures but doesn't show where it comes from;
update the example to import or document GenericError (e.g., reference
GenericError alongside CustomStorageObject/CustomStorageConfig) so readers can
resolve the type. Specifically, add or mention an import that includes
GenericError (the same module that exports
CustomStorageObject/CustomStorageConfig, or note it comes from
`@forgerock/sdk-types`) and ensure the README example references those symbols
(GenericError, CustomStorageObject, CustomStorageConfig) so the example compiles
for consumers.

In `@packages/sdk-types/README.md`:
- Around line 125-135: Update the README's build and test commands to reference
the correct Nx project name: replace occurrences of "nx build storage" and "nx
test storage" with "nx build sdk-types" and "nx test sdk-types" respectively so
the commands match the actual package; ensure the changes are made in
packages/sdk-types/README.md where the "Building" and "Testing" sections define
those commands.

In `@packages/sdk-utilities/README.md`:
- Around line 84-90: The README’s test command misspells the Nx project target;
update the command string in packages/sdk-utilities/README.md from "nx test
sdk-utiities" to the correct project name "nx test sdk-utilities" so the Nx test
target (sdk-utilities) will run correctly.
🧹 Nitpick comments (2)
packages/davinci-client/src/lib/fido/README.md (1)

7-8: Good addition—browser support note is helpful.

The note clearly states the browser requirement for WebAuthn APIs, which is important context for developers.

Optional enhancement: Consider adding browser compatibility details.

To make this more actionable for developers, you could optionally enhance the note with:

  • A link to browser compatibility information (e.g., MDN or caniuse.com)
  • Mention of how to detect/handle unsupported browsers
  • Minimum browser versions if applicable

Example:

-**Note**: To use this module, browser support is required for `navigator.credentials.create` and `navigator.credentials.get`
+**Note**: To use this module, browser support is required for [`navigator.credentials.create`](https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/create) and [`navigator.credentials.get`](https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/get). Check browser compatibility and consider feature detection before using this module.
packages/sdk-effects/iframe-manager/README.md (1)

89-103: Catch block example may be misleading given the new resolve behavior.

Since errorParams now causes the promise to resolve (not reject), the catch block at lines 89-103 will only handle truly unexpected errors or internal_error cases. The check for errorResult.error || errorResult.error_description at lines 94-98 within the catch block appears redundant with the new behavior, as server errors via errorParams should now be handled in the success path (lines 79-82).

Consider simplifying the catch block to only handle internal errors:

📝 Suggested simplification
   } catch (errorResult) {
-    // Failure case: Check if it's a known error from the server or an internal error
     if (errorResult && errorResult.type === 'internal_error') {
       // Timeout or iframe access error
       console.error(`Iframe operation failed: ${errorResult.message}`);
-    } else if (errorResult && (errorResult.error || errorResult.error_description)) {
-      // Error reported by the authorization server via errorParams
-      console.error('Silent login failed. Server returned error:', errorResult);
-      // const errorCode = errorResult.error;
-      // const errorDesc = errorResult.error_description;
     } else {
       // Other unexpected error
       console.error('An unexpected error occurred:', errorResult);
     }
   }

Comment on lines +44 to 54
const myCustomStore: CustomStorageObject = {
get: async (key: string): Promise<string | null | GenericError> => {
/* ... custom logic ... */
},
set: async (key, value) => {
set: async (key: string, valueToSet: string): Promise<void | GenericError> => {
/* ... custom logic ... */
},
remove: async (key) => {
remove: async (key: string): Promise<void | GenericError> => {
/* ... custom logic ... */
},
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing GenericError type reference in custom storage example.

The custom storage methods reference GenericError in their return types (e.g., Promise<string | null | GenericError>) but there's no import or explanation of where this type comes from.

📝 Suggested addition to imports or explanation

Either add to the import:

import { createStorage, type CustomStorageConfig, type CustomStorageObject, type GenericError } from '@forgerock/storage';

Or add a note explaining that GenericError is imported from @forgerock/sdk-types.

🤖 Prompt for AI Agents
In `@packages/sdk-effects/storage/README.md` around lines 44 - 54, The README
example uses the type GenericError in the CustomStorageObject method signatures
but doesn't show where it comes from; update the example to import or document
GenericError (e.g., reference GenericError alongside
CustomStorageObject/CustomStorageConfig) so readers can resolve the type.
Specifically, add or mention an import that includes GenericError (the same
module that exports CustomStorageObject/CustomStorageConfig, or note it comes
from `@forgerock/sdk-types`) and ensure the README example references those
symbols (GenericError, CustomStorageObject, CustomStorageConfig) so the example
compiles for consumers.

nx-cloud[bot]

This comment was marked as outdated.

Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud has identified a flaky task in your failed CI:

🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.

Nx Cloud View detailed reasoning in Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
packages/device-client/src/lib/device.store.ts (1)

339-344: ⚠️ Potential issue | 🟡 Minor

Remaining copy-paste JSDoc issues in the profile section.

The @function tag fix on line 343 is correct, but the surrounding JSDoc still has leftover issues from copy-paste:

  1. Line 340: Description says "Get profile devices" — should be "Delete a profile device" (same issue on line 317 for update, which says "Get profile devices" instead of "Update a profile device").
  2. Line 344: @param says "The query used to update a profile device" — should say "delete".
  3. Line 322 (the update method's @returns): Minor typo — "or or an error object" has a duplicated "or".

Since this PR targets comment fixes, consider cleaning these up as well.

📝 Proposed JSDoc fixes for the profile section

For the update method (lines 316–322):

      /**
-       * Get profile devices
+       * Update a profile device
        *
        * `@async`
        * `@function` update
        * `@param` {ProfileDevicesQuery} query - The query used to update a profile device
-       * `@returns` {Promise<ProfileDevice | { error: unknown }>} - A promise that resolves to the response data or or an error object if the response is not valid.
+       * `@returns` {Promise<ProfileDevice | { error: unknown }>} - A promise that resolves to the response data or an error object if the response is not valid.
        */

For the delete method (lines 339–344):

      /**
-       * Get profile devices
+       * Delete a profile device
        *
        * `@async`
        * `@function` delete
-       * `@param` {ProfileDevicesQuery} query - The query used to update a profile device
+       * `@param` {ProfileDevicesQuery} query - The query used to delete a profile device
        * `@returns` {Promise<null | { error: unknown }>} - A promise that resolves to null or an error object if the response is not valid.
        */
packages/sdk-effects/logger/README.md (1)

78-110: ⚠️ Potential issue | 🟡 Minor

Clarify that level filtering applies before delegating to custom logger.

The current text "all log calls will be delegated" is misleading—the implementation applies level filtering before delegation, so calls below the current level never reach the custom logger. Update to:

Suggested fix
-When a custom logger is provided, all log calls will be delegated to your implementation. If no custom logger is provided, the logger falls back to the browser's native `console` methods.
+When a custom logger is provided, log calls are first filtered by the current level, then delegated to your implementation. If no custom logger is provided, the logger falls back to the browser's native `console` methods.
packages/sdk-effects/iframe-manager/README.md (2)

49-54: ⚠️ Potential issue | 🔴 Critical

Critical: Inconsistent error handling documentation.

Lines 49-53 state that failures resolve with error objects, but line 54 says it returns "An Error" for validation failures (missing/empty successParams or errorParams). This is ambiguous:

  • Does line 54 mean the promise rejects with an Error (throwing synchronously or rejecting the promise)?
  • Or does it mean the promise resolves with an Error object?

This inconsistency will confuse developers about whether they need a try-catch block for validation errors.

Recommendation: Clarify whether validation errors reject the promise or resolve with an error object. If they reject, update the "On Failure" heading to distinguish between resolution-based errors and rejection-based errors.


89-103: ⚠️ Potential issue | 🟠 Major

Major: Catch block appears inconsistent with documented behavior.

The documentation states (lines 49-53) that internal errors resolve with objects like { type: 'internal_error', message: '...' }. However, the example's catch block (lines 89-103) attempts to handle these internal_error objects, which would never execute if they resolve rather than reject.

Additionally:

  • Lines 94-98 check for error/error_description in the catch block, but these are already handled at lines 79-82 in the try block.
  • If the promise always resolves (as stated in line 75), this entire catch block would only execute for the validation Error mentioned in line 54.

Recommendation: Clarify the catch block's purpose:

  1. If internal_error cases truly resolve (per docs), remove lines 91-93 from the catch block
  2. If error parameters truly resolve (per docs), remove lines 94-98 from the catch block
  3. Keep the catch block only if line 54 validation errors actually reject (and document this clearly)
🧹 Nitpick comments (2)
packages/sdk-effects/storage/README.md (1)

70-70: Minor style improvement: incomplete sentence.

The sentence lacks a subject. Consider revising for better readability.

✍️ Suggested style fix
-- `type`: Specifies the storage mechanism. Can be `'localStorage'`, `'sessionStorage'`, or `'custom'`.
+- `type`: Specifies the storage mechanism. It can be `'localStorage'`, `'sessionStorage'`, or `'custom'`.
packages/device-client/README.md (1)

233-236: Simplify the error checking logic.

The condition !Array.isArray(getResponse) || 'error' in getResponse is unnecessarily complex. Given the return type WebAuthnDevice[] | { error: unknown }, the || 'error' in getResponse part is redundant since arrays won't have an 'error' property. A cleaner and more idiomatic approach would be to use just the type guard 'error' in getResponse, which TypeScript will properly narrow.

📝 Suggested simplification
 const getResponse = await apiClient.webAuthn.get(query);
-if (!Array.isArray(getResponse) || 'error' in getResponse) {
+if ('error' in getResponse) {
   // handle get device error
 }

@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 18.82%. Comparing base (b89ad58) to head (5a9ea40).
⚠️ Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
...s/iframe-manager/src/lib/iframe-manager.effects.ts 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (40.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (18.82%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #526      +/-   ##
==========================================
+ Coverage   18.79%   18.82%   +0.03%     
==========================================
  Files         140      142       +2     
  Lines       27640    27730      +90     
  Branches      980      991      +11     
==========================================
+ Hits         5195     5221      +26     
- Misses      22445    22509      +64     
Files with missing lines Coverage Δ
packages/device-client/src/lib/device.store.ts 80.21% <ø> (ø)
packages/sdk-types/src/lib/authorize.types.ts 100.00% <ø> (ø)
...s/iframe-manager/src/lib/iframe-manager.effects.ts 0.94% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 6, 2026

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/davinci-client@526

@forgerock/device-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/device-client@526

@forgerock/journey-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/journey-client@526

@forgerock/oidc-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/oidc-client@526

@forgerock/protect

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/protect@526

@forgerock/sdk-types

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-types@526

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-utilities@526

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/iframe-manager@526

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-logger@526

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-oidc@526

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-request-middleware@526

@forgerock/storage

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/storage@526

commit: 5a9ea40

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Deployed a26239e to https://ForgeRock.github.io/ping-javascript-sdk/pr-526/a26239ed414a37a87e64d87de41025a641a5a474 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔻 @forgerock/journey-client - 0.0 KB (-82.5 KB, -100.0%)

📊 Minor Changes

📈 @forgerock/device-client - 9.3 KB (+0.0 KB)
📉 @forgerock/journey-client - 82.5 KB (-0.0 KB)
📉 @forgerock/sdk-types - 7.9 KB (-0.1 KB)
📈 @forgerock/iframe-manager - 2.4 KB (+0.0 KB)

➖ No Changes

@forgerock/oidc-client - 23.5 KB
@forgerock/protect - 150.1 KB
@forgerock/sdk-utilities - 8.5 KB
@forgerock/storage - 1.5 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/sdk-request-middleware - 4.5 KB
@forgerock/sdk-oidc - 2.6 KB
@forgerock/davinci-client - 39.8 KB


13 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

Copy link
Collaborator

@cerebrl cerebrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just left a single comment.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/device-client/src/lib/device.store.ts (1)

316-345: ⚠️ Potential issue | 🟡 Minor

JSDoc descriptions for profile.update and profile.delete still say "Get profile devices".

Lines 317 and 340 both read Get profile devices, but they document the update and delete methods respectively. The @function tags were correctly updated, but the summary lines were missed.

📝 Proposed fix
      /**
-       * Get profile devices
+       * Update a profile device
        *
        * `@async`
        * `@function` update
      /**
-       * Get profile devices
+       * Delete a profile device
        *
        * `@async`
        * `@function` delete
packages/sdk-effects/iframe-manager/README.md (2)

49-54: ⚠️ Potential issue | 🟡 Minor

API reference incorrectly states internal errors "resolve" — they actually reject.

Lines 51–53 describe timeout, cross-origin, and setup failures as resolving, but the implementation uses reject() for all three (lines 141, 156, and 165 in iframe-manager.effects.ts). Only the error-params case (line 50) truly resolves.

Suggested fix: split the section into "Resolves" (error params) and "Rejects" (internal errors).

Proposed doc fix
- **On Failure**: Resolves with:
-   - `ResolvedParams`: An object containing _all_ parsed query parameters if the final redirect URL contains any key listed in `errorParams`.
-   - An object `{ type: 'internal_error', message: 'iframe timed out' }` if the specified `timeout` is reached before a success or error condition is met.
-   - An object `{ type: 'internal_error', message: 'unexpected failure' }` if there's an error accessing the iframe's content window (most likely due to a cross-origin redirect that wasn't expected or handled).
-   - An object `{ type: 'internal_error', message: 'error setting up iframe' }` if there was an issue creating or configuring the iframe initially.
-   - An `Error` if `successParams` or `errorParams` are missing or empty during setup.
+ **On Error Params**: Resolves with `ResolvedParams` containing _all_ parsed query parameters if the final redirect URL contains any key listed in `errorParams`. The caller must inspect the result for error keys.
+ **On Failure (Rejects)**: Rejects with:
+   - `{ type: 'internal_error', message: 'iframe timed out' }` if the specified `timeout` is reached.
+   - `{ type: 'internal_error', message: 'unexpected failure' }` on cross-origin access errors.
+   - `{ type: 'internal_error', message: 'error setting up iframe' }` on iframe creation failure.
+   - Throws an `Error` synchronously if `successParams` or `errorParams` are missing or empty.

89-102: ⚠️ Potential issue | 🟡 Minor

Catch block in example contains dead code for the new error-params flow.

Lines 94–98 check for errorResult.error / errorResult.error_description inside the catch block, but with the new behavior, error params now resolve (handled on lines 79–82 in the try block). This branch is unreachable and will confuse readers about the new contract.

Suggested cleanup
   } catch (errorResult) {
-    // Failure case: Check if it's a known error from the server or an internal error
     if (errorResult && errorResult.type === 'internal_error') {
       // Timeout or iframe access error
       console.error(`Iframe operation failed: ${errorResult.message}`);
-    } else if (errorResult && (errorResult.error || errorResult.error_description)) {
-      // Error reported by the authorization server via errorParams
-      console.error('Silent login failed. Server returned error:', errorResult);
-      // const errorCode = errorResult.error;
-      // const errorDesc = errorResult.error_description;
     } else {
       // Other unexpected error
       console.error('An unexpected error occurred:', errorResult);
     }
   }

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/sdk-effects/sdk-request-middleware/README.md (1)

70-75: ⚠️ Potential issue | 🟡 Minor

Fix switch-case syntax in snippet.

case 'DAVINCI_NEXT' is missing a colon, which makes the example invalid for copy/paste.

🛠️ Proposed fix
-      case 'DAVINCI_NEXT'
+      case 'DAVINCI_NEXT':
packages/sdk-effects/iframe-manager/README.md (1)

89-103: ⚠️ Potential issue | 🟡 Minor

Stale error-handling branch in the catch block of the usage example.

Lines 94-98 check for errorResult.error / errorResult.error_description in the catch block, but with the new resolve-on-error-params behavior, server-reported errors will never reach catch — they'll be handled by the success path at lines 79-82. This dead branch in the example will confuse consumers trying to adopt the new API.

Suggested cleanup
   } catch (errorResult) {
-    // Failure case: Check if it's a known error from the server or an internal error
     if (errorResult && errorResult.type === 'internal_error') {
       // Timeout or iframe access error
       console.error(`Iframe operation failed: ${errorResult.message}`);
-    } else if (errorResult && (errorResult.error || errorResult.error_description)) {
-      // Error reported by the authorization server via errorParams
-      console.error('Silent login failed. Server returned error:', errorResult);
-      // const errorCode = errorResult.error;
-      // const errorDesc = errorResult.error_description;
     } else {
       // Other unexpected error
       console.error('An unexpected error occurred:', errorResult);
     }
   }
🤖 Fix all issues with AI agents
In `@packages/davinci-client/src/lib/fido/README.md`:
- Around line 7-8: Add a trailing period to the sentence that mentions browser
support for navigator.credentials.create and navigator.credentials.get (the
README line "**Note**: To use this module, browser support is required for
`navigator.credentials.create` and `navigator.credentials.get`") so the sentence
ends with a period.

In `@packages/sdk-effects/logger/README.md`:
- Around line 95-111: Update the README's documentation for the CustomLogger
interface to make cross-environment behavior explicit: replace the phrase "the
browser's native `console` methods" with "the native `console` methods (browser
or Node.js)" or similar, and ensure this note sits next to the `CustomLogger`
and `LogMessage` declarations; also update the `LogMessage` type suggestion in
the docs to recommend using `unknown` or `Record<string, unknown>` instead of
the broad `object` type so readers know to prefer safer types when implementing
`CustomLogger`.
- Around line 114-118: Update the README.md commands that currently say "Run `nx
build sdk-logger`" and "Run `nx test sdk-logger`" to match the repository
scripts: replace them with either the monorepo scripts "Run `pnpm nx nxBuild` to
build the library." and "Run `pnpm nx nxTest` to execute the unit tests via
Vitest." or use the pnpm filter syntax for the package `@forgerock/sdk-logger`:
"Run `pnpm --filter `@forgerock/sdk-logger` build`" and "Run `pnpm --filter
`@forgerock/sdk-logger` test`". Ensure both occurrences in README.md are updated
accordingly.

In `@packages/sdk-effects/sdk-request-middleware/README.md`:
- Around line 125-128: The docs for applyQuery are inconsistent: the text says
FetchArgs.url is a string but the example uses request.url as a URL object;
update the documentation and types to match the example by documenting that
FetchArgs.url may be a URL (or string) and adjust the callback signature
accordingly (e.g., `callback` receives modified `FetchArgs` where `url` is
`string | URL`), or alternatively change the example to treat request.url as a
string (e.g., use request.url.toString() or build a string URL) so both doc
comment and example agree; make sure to reference `applyQuery`, `callback`,
`FetchArgs`, and `request.url` when editing.
🧹 Nitpick comments (2)
packages/device-client/README.md (1)

234-234: Simplify error check for better TypeScript type narrowing.

The condition !Array.isArray(getResponse) || 'error' in getResponse is redundant. Using OR prevents TypeScript from properly narrowing the union type inside the if block. A single condition would be clearer and enable proper type inference.

♻️ Recommended simplification

Choose one of these approaches for better type narrowing:

Option 1: Check for error property

-if (!Array.isArray(getResponse) || 'error' in getResponse) {
+if ('error' in getResponse) {
   // handle get device error
 }

Option 2: Check if not an array

-if (!Array.isArray(getResponse) || 'error' in getResponse) {
+if (!Array.isArray(getResponse)) {
   // handle get device error
 }

Both options allow TypeScript to correctly narrow the type inside and after the if block.

packages/sdk-effects/logger/README.md (1)

42-63: Consider enhancing the custom logger example.

The placeholder comments /* custom logging */ are acceptable but could be more illustrative. Consider showing a concrete example that demonstrates actual logging behavior, such as forwarding to a third-party service or adding timestamps.

📝 More illustrative example
import { logger } from '@forgerock/sdk-logger';

// Example: Custom logger that forwards to an external service
const customLogger = {
  error: (...args) => {
    console.error(...args);
    externalService.logError(args);
  },
  warn: (...args) => console.warn('[WARNING]', ...args),
  info: (...args) => console.info('[INFO]', ...args),
  debug: (...args) => console.debug('[DEBUG]', ...args),
};

const log = logger({ level: 'info', custom: customLogger });

Comment on lines +7 to +8
**Note**: To use this module, browser support is required for `navigator.credentials.create` and `navigator.credentials.get`

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Minor: missing period at end of sentence.

Proposed fix
-**Note**: To use this module, browser support is required for `navigator.credentials.create` and `navigator.credentials.get`
+**Note**: To use this module, browser support is required for `navigator.credentials.create` and `navigator.credentials.get`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**Note**: To use this module, browser support is required for `navigator.credentials.create` and `navigator.credentials.get`
**Note**: To use this module, browser support is required for `navigator.credentials.create` and `navigator.credentials.get`.
🤖 Prompt for AI Agents
In `@packages/davinci-client/src/lib/fido/README.md` around lines 7 - 8, Add a
trailing period to the sentence that mentions browser support for
navigator.credentials.create and navigator.credentials.get (the README line
"**Note**: To use this module, browser support is required for
`navigator.credentials.create` and `navigator.credentials.get`") so the sentence
ends with a period.

Comment on lines +95 to +111
### `CustomLogger` Interface

Defines the interface for custom logger implementations:

```typescript
interface CustomLogger {
error: (...args: LogMessage[]) => void;
warn: (...args: LogMessage[]) => void;
info: (...args: LogMessage[]) => void;
debug: (...args: LogMessage[]) => void;
}

type LogMessage = string | number | object;
```

When a custom logger is provided, all log calls will be delegated to your implementation. If no custom logger is provided, the logger falls back to the browser's native `console` methods.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

find packages/sdk-effects/logger/src -type f \( -name "*.ts" -o -name "*.tsx" \) | head -20

Repository: ForgeRock/ping-javascript-sdk

Length of output: 311


🏁 Script executed:

rg -l "CustomLogger" packages/sdk-effects/logger/src --type ts --type tsx

Repository: ForgeRock/ping-javascript-sdk

Length of output: 100


🏁 Script executed:

rg "interface CustomLogger|type LogMessage" packages/sdk-effects/logger/src -A 10 -B 2

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1175


🏁 Script executed:

cat packages/sdk-effects/logger/README.md | sed -n '95,111p'

Repository: ForgeRock/ping-javascript-sdk

Length of output: 608


🏁 Script executed:

cat packages/sdk-effects/logger/src/lib/logger.effects.ts

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1901


🏁 Script executed:

rg "console\." packages/sdk-effects/logger/src -B 2 -A 2

Repository: ForgeRock/ping-javascript-sdk

Length of output: 910


🏁 Script executed:

rg "window|browser|globalThis" packages/sdk-effects/logger/src

Repository: ForgeRock/ping-javascript-sdk

Length of output: 55


Update documentation to clarify cross-environment support.

The CustomLogger interface and LogMessage type accurately reflect the implementation. However, line 110 is misleading: it states "browser's native console methods," but the logger falls back to the native console in both browser and Node.js environments. The implementation uses standard console.error, console.warn, console.info, and console.debug—all of which are available in both environments.

Revise line 110 to clarify this: "the logger falls back to the native console methods" or "the browser or Node.js console methods."

Additionally, the LogMessage type uses object, which is a broad TypeScript type. Consider using unknown or Record<string, unknown> for better type safety.

🤖 Prompt for AI Agents
In `@packages/sdk-effects/logger/README.md` around lines 95 - 111, Update the
README's documentation for the CustomLogger interface to make cross-environment
behavior explicit: replace the phrase "the browser's native `console` methods"
with "the native `console` methods (browser or Node.js)" or similar, and ensure
this note sits next to the `CustomLogger` and `LogMessage` declarations; also
update the `LogMessage` type suggestion in the docs to recommend using `unknown`
or `Record<string, unknown>` instead of the broad `object` type so readers know
to prefer safer types when implementing `CustomLogger`.

Comment on lines +114 to +118
Run `nx build sdk-logger` to build the library.

## Running unit tests

Run `nx test @forgerock/sdk-logger` to execute the unit tests via [Vitest](https://vitest.dev/).
Run `nx test sdk-logger` to execute the unit tests via [Vitest](https://vitest.dev/).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Check project.json in the logger directory
echo "=== Checking project.json ==="
if [ -f "packages/sdk-effects/logger/project.json" ]; then
  cat packages/sdk-effects/logger/project.json
else
  echo "project.json not found"
fi

echo -e "\n=== Checking nx.json ==="
if [ -f "nx.json" ]; then
  cat nx.json | head -50
fi

echo -e "\n=== Listing packages/sdk-effects directory ==="
ls -la packages/sdk-effects/

echo -e "\n=== Checking for project definitions in root ==="
find . -maxdepth 2 -name "project.json" -o -name "workspace.json" 2>/dev/null

Repository: ForgeRock/ping-javascript-sdk

Length of output: 2155


🏁 Script executed:

#!/bin/bash

echo "=== Root project.json ==="
cat project.json 2>/dev/null || echo "No root project.json"

echo -e "\n=== Logger package.json ==="
if [ -f "packages/sdk-effects/logger/package.json" ]; then
  cat packages/sdk-effects/logger/package.json
else
  echo "package.json not found in logger directory"
fi

echo -e "\n=== Check if nx recognizes sdk-logger project ==="
# Try to list nx projects
nx show projects 2>/dev/null || echo "Could not list nx projects"

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1401


🏁 Script executed:

#!/bin/bash

echo "=== Check nx workspace layout ==="
# Try different approaches to list nx projects
if [ -f "package.json" ]; then
  echo "Root package.json workspaces:"
  cat package.json | grep -A 20 "workspaces"
fi

echo -e "\n=== Check for pnpm workspace ==="
if [ -f "pnpm-workspace.yaml" ]; then
  cat pnpm-workspace.yaml
fi

echo -e "\n=== List all package.json files in packages ==="
find packages -name "package.json" -type f | head -20

echo -e "\n=== Check logger's actual nx targets ==="
cd packages/sdk-effects/logger && cat package.json | jq '.scripts'

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1475


🏁 Script executed:

#!/bin/bash

echo "=== Check another package for comparison ==="
if [ -f "packages/davinci-client/package.json" ]; then
  echo "DaVinci client package.json scripts:"
  cat packages/davinci-client/package.json | jq '.scripts'
fi

echo -e "\n=== Try to infer nx project names ==="
# Check if there's an nx.json that defines projects
if [ -f "nx.json" ]; then
  echo "Checking nx.json for project configuration..."
  cat nx.json | grep -A 10 "projects" || echo "No explicit projects defined in nx.json"
fi

echo -e "\n=== Check if nxBuild is a custom target ==="
# Search for nxBuild target definition
rg "nxBuild" --type json -A 3 -B 3 | head -50

echo -e "\n=== Try to run nx commands to see available projects ==="
cd packages/sdk-effects/logger && pnpm nx show project . --json 2>&1 | head -20

Repository: ForgeRock/ping-javascript-sdk

Length of output: 5321


Update commands to match the actual package.json scripts.

The documented commands nx build sdk-logger and nx test sdk-logger don't match the scripts defined in package.json. All packages in this repository use pnpm nx nxBuild and pnpm nx nxTest without specifying a project name.

Update lines 114 and 118 to:

  • Run pnpm nx nxBuild to build the library.
  • Run pnpm nx nxTest to execute the unit tests via Vitest.

Or alternatively, use the pnpm filter syntax:

  • Run pnpm --filter @forgerock/sdk-logger build to build the library.
  • Run pnpm --filter @forgerock/sdk-logger test to execute the unit tests via Vitest.
🤖 Prompt for AI Agents
In `@packages/sdk-effects/logger/README.md` around lines 114 - 118, Update the
README.md commands that currently say "Run `nx build sdk-logger`" and "Run `nx
test sdk-logger`" to match the repository scripts: replace them with either the
monorepo scripts "Run `pnpm nx nxBuild` to build the library." and "Run `pnpm nx
nxTest` to execute the unit tests via Vitest." or use the pnpm filter syntax for
the package `@forgerock/sdk-logger`: "Run `pnpm --filter `@forgerock/sdk-logger`
build`" and "Run `pnpm --filter `@forgerock/sdk-logger` test`". Ensure both
occurrences in README.md are updated accordingly.

Comment on lines +125 to +128
- `callback`: An async function that takes the modified `FetchArgs` (with `url` as a string) and returns a Promise that resolves to a `QueryReturnValue`

**Returns:**
A Promise with the result of the callback function
A Promise that resolves to a `QueryReturnValue<unknown, FetchBaseQueryError, FetchBaseQueryMeta>`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Align applyQuery docs with the example’s request.url type.

The description says url is a string, but the example treats request.url as a URL object. Either update the doc to reflect a URL type or adjust the example to use a string to avoid confusion.

🤖 Prompt for AI Agents
In `@packages/sdk-effects/sdk-request-middleware/README.md` around lines 125 -
128, The docs for applyQuery are inconsistent: the text says FetchArgs.url is a
string but the example uses request.url as a URL object; update the
documentation and types to match the example by documenting that FetchArgs.url
may be a URL (or string) and adjust the callback signature accordingly (e.g.,
`callback` receives modified `FetchArgs` where `url` is `string | URL`), or
alternatively change the example to treat request.url as a string (e.g., use
request.url.toString() or build a string URL) so both doc comment and example
agree; make sure to reference `applyQuery`, `callback`, `FetchArgs`, and
`request.url` when editing.

@ancheetah ancheetah merged commit 4c0025a into main Feb 11, 2026
8 checks passed
@ancheetah ancheetah deleted the readmes-2.0 branch February 11, 2026 15:02
@ryanbas21 ryanbas21 mentioned this pull request Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants